package com.ktc.demo;

import com.ktc.user.UserApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
@SpringBootTest(classes = UserApplication.class)
@RunWith(SpringRunner.class)
public class Demo01 {

    @Autowired
    private BCryptPasswordEncoder encoder;


    @Test
    public void test() {

        /*
        $2a$10$/.TqRw/0F6KgXV/guTmdB.oTdedTqT44wnB3K7wxPaC/btd9DVvUW
        $2a$10$BnL5zLfPkT1rd0/G669DV.7HMKEJByCdD0zM21mrZQoYaLqP6DVn2
        $2a$10$AIJky0Y5Fb0sSLzVUB28..rDX3Z5/Xj1HBoh05tA9eHjmIFpVgk6W
        $2a$10$hAs744ZK6eOUJfD3mYnvP.7MXwN16cQkHrnPAaMhS71FucbtRSohC
        $2a$10$40UedUlfsCHFwIkUUkMdk.bHB.B9WnNOwRqEtPaslD6x9v03/qn5G
        $2a$10$q269Ht3j.WmGw42nde2ex.LC5JSGsYjVBJDxuWqbDJfGROWS8prwW
        $2a$10$6E0iP7EAhHkiFZ5VPi3zgeVgCv3WYGIby.DQ3TDo0N2Xk7EXIOEo2
        $2a$10$Qb/e4IWz/PBgBHZYPQc4eOyXEyYtPX7T7iB7nV1c9IOjIJo1MrRnG
        $2a$10$QiSqFaBctYGyr5suG7auvezWpqHEuXJTS/T3atbdUhu4kh7gSWDuW
        $2a$10$poTYWsWOQmOW0N.o4S3hMubcnDJkA8Q6hkPfcBWz70lKm451/fZWa
         */

        String pass="$2a$10$q269Ht3j.WmGw42nde2ex.LC5JSGsYjVBJDxuWqbDJfGROWS8prwW";
        System.out.println(encoder.matches("admin",pass));

        /*for (int i=0;i<10;i++){
            System.out.println(encoder.encode("admin"));
        }*/

    }

}
